<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<c:import url="/WEB-INF/jsp/head.jsp"/>
</head>
<body>

	<c:import url="/WEB-INF/jsp/cabecalho.jsp" />
	
	<h3 align="center">Controle de Questionários</h3>
	
	<div align="center"><a href="<c:url value="/questionario/form"/>">Incluir Questionário</a></div>

	<br /><br />
	
	<div class="resposta">	
		<c:if test="${not empty questionarioList}">

			<table width="600" border="0" align="center">
				<thead>
					<tr>
						<th width="40" align="center" scope="col">ID</th>
						<th align="left" scope="col">Objetivo</th>
						<th width="20" align="center" scope="col">&nbsp;</th>
						<th width="20" align="center" scope="col">&nbsp;</th>
					</tr>
				</thead>
				<tbody class="zebrado">
					<c:forEach items="${questionarioList}" var="questionario">
						<tr>
							<td align="center">${questionario.id}</td>
							<td align="left">${questionario.objetivo}</td>
							<td align="center">
								<a href="javascript: window.location='<c:url value="/questionario/form/${questionario.id}"/>'">
									<img src="<c:url value="/img/icone_editar.png"/>" alt="Editar" title="Editar" style="cursor: pointer" border="0"/>
								</a>
							</td>
							<td align="center">
								<a href="javascript: excluir('<c:url value="/questionario"/>', '${questionario.id}')">
									<img src="<c:url value="/img/icone_excluir.png"/>" alt="Excluir" title="Excluir" style="cursor: pointer" border="0"/>
								</a>
							</td>
						</tr>
					</c:forEach>

				</tbody>
			</table>
								
		</c:if>
		<c:if test="${empty questionarioList}">
			<div align="center">Não foi encontrado nenhum resultado com os parâmetros informados.</div>
		</c:if>
	</div>

	<div align="center">
		<br /><br /><br />
		<a href="<c:url value="/"/>">Voltar</a>
	</div>

	<c:import url="/WEB-INF/jsp/rodape.jsp"/>
	
</body>
</html>